package com.circle.rest.core.common.enums;

/**
 * @program: RestfulApi
 * @description: 推送类型
 * @author: 赵航
 * @create: 2019-04-09 13:33
 **/
public enum NtPushType {
    TEXT(1, "文本"),
    URL(2, "链接");

    int code;
    String message;

    NtPushType(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public static String valueOf(Integer value) {
        if (value == null) {
            return "";
        } else {
            for (NtPushType ms : NtPushType.values()) {
                if (ms.getCode() == value) {
                    return ms.getMessage();
                }
            }
            return "";
        }
    }
}
